// Component({
//   properties: {

//   },
//   data: {
//     list: [{
//       "pagePath": "pages/list/list",
//       "text": "工作",
//       "iconPath": "./images/list/ciwei.png",
//       "selectedIconPath": "./images/list/ciwei_hl.png"
//     },
//     {
//       "pagePath": "pages/list/list",
//       "text": "助手",
//       "iconPath": "./images/list/ciwei.png",
//       "selectedIconPath": "./images/list/ciwei_hl.png"
//     },
//     {
//       "pagePath": "pages/list/list",
//       "text": "常用",
//       "iconPath": "./images/tabbar-icon3.png",
//       "selectedIconPath": "./images/tabbar-icon3.png",
//     },
//     {
//       "pagePath": "pages/list/list",
//       "text": "分析",
//       "iconPath": "./images/list/ciwei.png",
//       "selectedIconPath": "./images/list/ciwei_hl.png"
//     },
//     {
//       "pagePath": "pages/list/list",
//       "text": "我",
//       "iconPath": "./images/list/ciwei.png",
//       "selectedIconPath": "./images/list/ciwei_hl.png"
//     }],
//     currentindex: 0
//   },
//   methods: {
//     switchTab(e) {
//       let url = '/' + e.currentTarget.dataset.path
//       this.setData({
//         currentindex: e.currentTarget.dataset.index
//       })

//       wx.switchTab({
//         url: url,
//       })
//     }
//   }
// })

// 获取应用实例
// const app = getApp()
// app.getSystemInfo();
Component({
  data: {
    isIphoneX: -1,
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [{
      "pagePath": "pages/list/list",
      "text": "工作",
      "iconPath": "/images/list/ciwei.png",
      "selectedIconPath": "/images/list/ciwei_hl.png"
    },
    {
      "pagePath": "pages/list/list",
      "text": "助手",
      "iconPath": "/images/list/ciwei.png",
      "selectedIconPath": "/images/list/ciwei_hl.png"
    },
    {
      "pagePath": "pages/list/list",
      "text": "常用",
      "iconPath": "/images/tabbar-icon3.png",
      "selectedIconPath": "/images/tabbar-icon3.png",
    },
    {
      "pagePath": "pages/list/list",
      "text": "分析",
      "iconPath": "/images/list/ciwei.png",
      "selectedIconPath": "/images/list/ciwei_hl.png"
    },
    {
      "pagePath": "pages/list/list",
      "text": "我",
      "iconPath": "/images/list/ciwei.png",
      "selectedIconPath": "/images/list/ciwei_hl.png"
    }]
  },
  lifetimes: {
    attached: function() {
      // 在组件实例进入页面节点树时执行
      let that = this
      wx.getSystemInfo({
        success: function (res) {
          // t.globalData.systemInfo = res;
          console.log(res)
          that.setData({
            isIphoneX:res.model.search('iPhone 1') != -1 ? 1 : 0
          })
        }
      });
    },
    detached: function() {
      // 在组件实例被从页面节点树移除时执行
    },
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})